import numpy as np
from pandas import DataFrame
from freegames import square

def init_board(size):
    return [[square() for _ in range(size)] for _ in range(size)]
# 继续四连珠代码
def play(tl, pg, width, height):
    while True:
        up = pg.onclick()
        if up:
            x, y = up.x // width, up.y // height
            pg.clear()
            draw_board(pg, tl)
            pg.goto(x * width + width / 2, y * height + height / 2)
            pg.pendown()
            pg.dot(10)
            pg.penup()
            if check_win(tl[x][y]):
                break

if __name__ == '__main__':
    board = init_board(3)
    play(turtle.Turtle(), turtle.Screen(), 100, 10012)
